import com.tledu.spring06.spring04.model.User;
import com.tledu.spring06.spring04.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 通过配置文件的方式实现aop
 *
 * @author Antg
 * @date 2021/8/914:40
 */
public class AspectWithXML {
    @Test
    public void test() {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserServiceImpl userService = applicationContext.getBean("userService", UserServiceImpl.class);
        userService.insert(new User());
    }
}
